package com.ruoyi.project.sdi.sdiPaeaArc.enums;

import java.util.HashMap;
import java.util.Map;


/**
 * <p>
 * Description: 描述案卷批次状态：包括待扫描，待识别、待补录、已删除等状态
 * </p>
 * @author 关晓强
 * @version 1.0
 * @see
 */
public enum ArchivePaeaStatus {
	WaitScan(100, "待扫描传输") {
		public ArchivePaeaStatus nextStatus() {
			return WaitOcr;
		}

	},

	WaitOcr(200, "待OCR识别") {
		public ArchivePaeaStatus nextStatus() {
			return Ocring;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}

	},
	Ocring(250, "正在OCR识别") {
		public ArchivePaeaStatus nextStatus() {
			return WaitManualClassify;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return WaitOcr;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}
		public boolean needUnlock() {
			return true;
		}
		
	},
	WaitManualClassify(351, "待人工分类") {
		public ArchivePaeaStatus nextStatus() {
			return ManualClassifying;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}

	},
	ManualClassifying(352, "正在人工分类") {
		public ArchivePaeaStatus nextStatus() {
			return WaitDataInput;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return WaitManualClassify;
		}
		public boolean needUnlock() {
			return true;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}
	},
	WaitTradeMatch(300, "待流水勾对") {
		public ArchivePaeaStatus nextStatus() {
			return TradeMatching;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}

	},
	TradeMatching(350, "正在流水勾对") {
		public ArchivePaeaStatus nextStatus() {
			return WaitManualClassify;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return WaitTradeMatch;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}
		public boolean needUnlock() {
			return true;
		}
	},

	WaitDataInput(400, "待手工补录") {
		public ArchivePaeaStatus nextStatus() {
			return DataInputing;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}

	},
	DataInputing(450, "正在手工补录") { ////暂时注释  提交批次后直接归档
		public ArchivePaeaStatus nextStatus() {
			//modify by lisc 2012-04-16 手工补录之后下一步走到待三次补录下面
			return WaitForceInput;
			//return WaitThirdOcr;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return WaitDataInput;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return WaitDataInput;
		}
		public boolean needUnlock() {
			return true;
		}
	},
	DataInputStop(455, "手工补录挂起") {
		public ArchivePaeaStatus nextStatus() {
			return DataInputStop;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return WaitDataInput;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return WaitDataInput;
		}
	},
	WaitThirdOcr(480, "待三次识别") {
		public ArchivePaeaStatus nextStatus() {
			return ThirdOcring;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return WaitDataInput;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return WaitThirdOcr;
		}
	},
	ThirdOcring(485, "正在三次识别") {
		public ArchivePaeaStatus nextStatus() {
			return WaitForceInput;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return WaitThirdOcr;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return WaitDataInput;
		}
		public boolean needUnlock() {
			return true;
		}
	},
	WaitForceInput(500, "待二次补录") {
		public ArchivePaeaStatus nextStatus() {
			return ForceInputing;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return WaitDataInput;
		}

	},
	ForceInputing(550, "正二次补录") {
		public ArchivePaeaStatus nextStatus() {
			return Complete;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return WaitForceInput;
		}
		public boolean needUnlock() {
			return true;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return WaitDataInput;
		}
	},
	无流水状态700(700, "无流水状态") {
		public ArchivePaeaStatus nextStatus() {
			return Complete;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return 无流水状态700;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}
	},
	待重新补录790(790, "待重新补录") {
		public ArchivePaeaStatus nextStatus() {
			return 正在重新补录795;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}

	},
	正在重新补录795(795, "正在重新补录") {
		public ArchivePaeaStatus nextStatus() {
			return Complete;
		}
		public ArchivePaeaStatus getUnlockStatus() {
			return 待重新补录790;
		}
		public boolean needUnlock() {
			return true;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}

	},
	Complete(800, "已归档") {
		public ArchivePaeaStatus nextStatus() {
			return Complete;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return 待重新补录790;
		}

	},
//	CompleteDel(850, "已归档已删背面") {
//		public ArchivePaeaStatus nextStatus() {
//			return CompleteDel;
//		}
//		public ArchivePaeaStatus getUnlockStatus() {
//			return Complete;
//		}
//		public ArchivePaeaStatus getAfterReScanStatus() {
//			return 待重新补录790;
//		}
//	},

	Deleted(-100, "已删除") {
		public ArchivePaeaStatus nextStatus() {
			return Deleted;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}

	},
	DeletedForever(-150, "物理删除") {
		public ArchivePaeaStatus nextStatus() {
			return DeletedForever;
		}
		public ArchivePaeaStatus getAfterReScanStatus() {
			return this;
		}

	}/* , ErrorStatus(-999, "已取消") */;

	public static ArchivePaeaStatus toArcBatchStatus(Integer value) {
		return codeMap.get(value);
	}

	public static String getNameByCode(Integer value) {
		ArchivePaeaStatus status = codeMap.get(value);
		if (status != null) {
			return status.getName();
		}
		return "未知状态";
	}

	private static Map<Integer, ArchivePaeaStatus> codeMap;
	private static Map<String, ArchivePaeaStatus> nameMap;
	static {
		codeMap = new HashMap<Integer, ArchivePaeaStatus>();
		nameMap = new HashMap<String, ArchivePaeaStatus>();
		for (ArchivePaeaStatus status : ArchivePaeaStatus.values()) {
			codeMap.put(status.getValue(), status);
			nameMap.put(status.getName(), status);
		}
	}
	private Integer value;
	private String name;

	private ArchivePaeaStatus(int value, String name) {
		this.value = value;
		this.name = name;
	}

	public int getValue() {
		return value;
	}

	public String getName() {
		return name;
	}

	public String toString() {
		return this.getValue() + "-" + this.getName();
	}

	public abstract ArchivePaeaStatus nextStatus();
	public ArchivePaeaStatus getUnlockStatus() {
		return this;
	}
	public ArchivePaeaStatus getAfterReScanStatus() {
		return WaitDataInput;
	}
	public boolean needUnlock() {
		return false;
	}
	public static void main(String[] args) {
		for (ArchivePaeaStatus status : ArchivePaeaStatus.values()) {
		//	//System.out.println(status);
		}
	}
}